<#include "/common/include.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增销售订单">
</@header>
<@addorEdit fromId="form-saleorder-add">
<input  type="hidden" name="userId" value="${user.id}">
<input  type="hidden" name="userName" value="${user.name}">
<input  type="hidden" name="modelKey" value="${bpmTaskFrom.modelKey}">
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "表单名称"/>：</label>
    <div class="col-sm-8">
        <input name="fromName"  value="${bpmTaskFrom.fromName}" class="form-control" type="text" readonly="true">
    </div>
</div>
<!--    <div class="form-group">-->
<!--        <label class="col-sm-3 control-label"><@ctx.i18n text = "流程实例ID"/>:                 -->
<!--        </label>-->
<!--        <div class="col-sm-8"><input name="processInstanceId" disabled class="form-control" type="text">            -->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "订单号"/>:                 
        </label>
        <div class="col-sm-8"><input name="saleCode" class="form-control" disabled type="text" value="${salecode}">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售员"/>:                 
        </label>
        <div class="col-sm-8"><input name="salePerson" class="form-control" type="text">            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售组"/>:                 
        </label>
        <div class="col-sm-8"><input name="saleTeam" class="form-control" type="text">            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售经理"/>:                 
        </label>
        <div class="col-sm-8"><input name="saleManager" class="form-control" type="text">            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "订单状态"/>：</label>
        <div class="col-sm-8">
            <select id="saleStatus" name="saleStatus" class="form-control">
                <#list dict.getType('saleorder_status')>
                    <#items as d>
                        <#if d.status =='0' >
                           <option  value="${d.dictValue}" text="${d.dictLabel}">${d.dictLabel}</option>
                        </#if>
                    </#items>
                 </#list>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户名称"/>:                                                   
        </label>
        <div class="col-sm-8"><input name="saleCustomername" class="form-control" type="text" required>                                                <span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i>请填写客户名称</span>                            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户地址"/>:                                                   
        </label>
        <div class="col-sm-8"><input name="saleAddress" class="form-control" type="text" required>                                                <span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i>请填写客户地址</span>                            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户手机号"/>:                                                   
        </label>
        <div class="col-sm-8"><input name="salePhone" class="form-control" type="text" required>                                                <span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i>请填写手机号</span>                            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户邮箱"/>:                                                   
        </label>
        <div class="col-sm-8"><input name="saleEmail" class="form-control" type="text" required>                                                <span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i>请填写邮箱</span>                            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户微信"/>:                                                   
        </label>
        <div class="col-sm-8"><input name="saleWechat" class="form-control" type="text" required>                                                <span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i>请填写微信</span>                            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "ID"/>：</label>
        <div class="col-sm-8">
           <#list dict.getType('sale_id_status')>
                <#items as d>
                    <#if d.status =='0' >
                        <div class="radio-box">
                            <input type="radio" id="saleId_${d.dictCode}" name="saleId"
                                   value="${d.dictValue}" <#if d.isDefault =="Y" >checked</#if>>
                            <label for="${d.dictCode}" text="${d.dictLabel}">${d.dictLabel}</label>
                        </div>
                    </#if>
                </#items>
            </#list>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "驾照"/>:                 
        </label>
        <div class="col-sm-8"><input name="saleDriverlicense" class="form-control" type="text">            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "护照"/>:                 
        </label>
        <div class="col-sm-8"><input name="salePassport" class="form-control" type="text">            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "房产信息"/>:                 
        </label>
        <div class="col-sm-8"><input name="saleResidenceinfo" class="form-control" type="text" required>            
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="remark" class="form-control"></textarea>
        </div>
    </div>
</@addorEdit>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bpm/saleorder"
    $("#form-saleorder-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/add", $('#form-saleorder-add').serialize());
        }
    }
</script>
</@footer>
</@pageTheme>